package com.mingqi.enetconnected.util;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;

import com.mingqi.enetconnected.base.MyApplication;

public class AppUtils {
    /**
     * 百度推送KEY
     */
    public final static String BAIDU_PUSH_KEY = "KPANw4QfRig5ep7yvK71Gz0S";

    /**
     * @param cxt
     * @return
     */
    public static String getAppVersion(Context cxt) {
        PackageManager manager = cxt.getPackageManager();
        PackageInfo packpageinfo = null;
        String curver = "1.00.00";
        try {
            packpageinfo = manager.getPackageInfo(MyApplication.PACKAGE_NAME, 0);
            if (packpageinfo != null) {
                curver = packpageinfo.versionName;
            }
        } catch (PackageManager.NameNotFoundException e) {
        }
        return curver;
    }

    public static String getPhotoName() {
        return System.currentTimeMillis() + ".jpg";
    }
}
